﻿//var fs_maxWindow = false;
var customColumns = true;
fs.util.pageLoadFunction.push(function () {
    fs_maxWindow = true;
    firstColumns = [
              { index: 0, headerText: "Base", edit: true, readonly: true, width: 80, rowText: "Budget" },
              { index: 1, headerText: "Actual", edit: true, readonly: true, width: 80, rowText: "Actual" },
              { index: 2, headerText: "Variance", edit: true, readonly: true, width: 80, rowText: "Variance" },
              { index: 4, headerText: "Vol", edit: true, width: 80, rowText: "Vol" },
              { index: 5, headerText: "Mix", edit: true, width: 80, rowText: "Mix" },
              { index: 6, headerText: "Price", edit: true, width: 80, rowText: "Price" },

              { index: 7, headerText: "", edit: false, width: 80, rowText: "empty", readonly: true },

              { index: 8, headerText: "Market price", edit: true, width: 80, rowText: "MP" },
              { index: 9, headerText: "First product price", edit: true, width: 80, rowText: "FPP" },
              { index: 10, headerText: "Productivity", edit: true, width: 80, rowText: "PRO" },
              { index: 11, headerText: "Pass through", edit: true, width: 80, rowText: "PT" },
              { index: 12, headerText: "Others", edit: true, width: 80, rowText: "Others" },

              { index: 7, headerText: "", edit: false, width: 80, rowText: "empty", readonly: true },
              { index: 14, headerText: "Control", edit: true, width: 80, rowText: "Control", style: "red", readonly: true },
              { index: 14, headerText: "Control", edit: true, width: 80, rowText: "Control1", style: "red", readonly: true }
            ];

    columnsCategory = [
    { colspan: 6, text: "" },
    { colspan: 3, text: "Total Variance" },
    { colspan: 0, text: "" },
    { colspan: 5, text: "Price Variance" },
    { colspan: 0, text: "" },
    { colspan: 2, text: ""}]
});

var readyJSON = [
{ emptyrow: true, insertcontrol: false, description: "Budget", bold: true },

{ accountcode: "VM01010100", description: "Total Product Sales", unit: "", digits: 0, datarow: true,
    Process: [{
        Field: "Budget",
        Budget: true,
        Exp: {
            mode: "refrence", list: "Budget_PSBR", fields: ["SV03020300"], equ: "+", postf: "T"
        }
    }, {
        Field: "Actual",
        Exp: {
            mode: "refrence", list: "Product Sales By RGC", fields: ["CM_T_SV01010300"], equ: "+"
        }
    }, {
        Field: "Variance",
        Exp: {
            mode: "search", fields: ["Actual", "Budget"], equ: "-", selfline: true
        }
    }, {
        Field: "Control",
        Exp: {
            mode: "search", fields: ["Variance", "Vol", "Mix", "Price"], equ: "-", selfline: true
        }
    }, {
        Field: "Control1",
        Exp: {
            mode: "search", fields: ["Price", "MP", "FPP", "PRO", "PT", "Others"], equ: "-", selfline: true
        }
    }
    ]
},
{ emptyrow: true, description: "N-1", bold: true },

{ accountcode: "VM01010200", description: "Total Product Sales", unit: "", digits: 0, datarow: true,
    Process: [{
        Field: "Budget",
        Exp: {
            mode: "refrence", list: "Product Sales By RGC", fields: ["CM_T_SV01010300"], equ: "+", lastyear: true
        }
    }, {
        Field: "Actual",
        Exp: {
            mode: "refrence", list: "Product Sales By RGC", fields: ["CM_T_SV01010300"], equ: "+"
        }
    }, {
        Field: "Variance",
        Exp: {
            mode: "search", fields: ["Actual", "Budget"], equ: "-", selfline: true
        }

    }, {
        Field: "Control",
        Exp: {
            mode: "search", fields: ["Variance", "Vol", "Mix", "Price"], equ: "-", selfline: true
        }
    }, {
        Field: "Control1",
        Exp: {
            mode: "search", fields: ["Price", "MP", "FPP", "PRO", "PT", "Others"], equ: "-", selfline: true
        }
    }
    ]
},
{ emptyrow: true, description: "FCST M-1", bold: true },

{ accountcode: "VM01010300", description: "Total Product Sales", unit: "", digits: 0, datarow: true,
    Process: [{
        Field: "Budget",
        Forecast:true,
        Exp: {
            mode: "refrence", list: "Forecast_PSBR", fields: ["SV04010300"], equ: "+", postf: "T", lastyear: false,lastmonth:true
        }
    }, {
        Field: "Actual",
        Exp: {
            mode: "refrence", list: "Product Sales By RGC", fields: ["CM_T_SV01010300"], equ: "+"
        }
    }, {
        Field: "Variance",
        Exp: {
            mode: "search", fields: ["Actual", "Budget"], equ: "-", selfline: true
        }
    }, {
        Field: "Control",
        Exp: {
            mode: "search", fields: ["Variance", "Vol", "Mix", "Price"], equ: "-", selfline: true
        }
    }, {
        Field: "Control1",
        Exp: {
            mode: "search", fields: ["Price", "MP", "FPP", "PRO", "PT", "Others"], equ: "-", selfline: true
        }
    }
    ]
},
{ emptyrow: true, description: "" }
];

